package com.hwzn.module.core.utils;

import org.springframework.security.core.context.SecurityContextHolder;

import com.hwzn.module.core.dos.UserDO;

/**
 * get context user
 *
 * @author jiaobo
 * @date Created in 2024/5/20 13:40
 * @company hw
 **/
public class SecurityContextUtil {

    public static UserDO getUser() {
        return (UserDO) SecurityContextHolder.getContext()
                .getAuthentication().getPrincipal();
    }

}
